home *** CD-ROM | disk | FTP | other *** search
/ Enter 2004 January / enter-2004-01.iso / files / maxima-5.9.0.exe / {app} / share / maxima / 5.9.0 / src / numerical / slatec / initds.lisp < prev    next >
Encoding:
Text File  |  2003-02-09  |  1.2 KB  |  37 lines

  1. ;;; Compiled by f2cl version 2.0 beta 2002-05-06
  2. ;;; 
  3. ;;; Options: ((:prune-labels nil) (:auto-save t) (:relaxed-array-decls t)
  4. ;;;           (:coerce-assigns :as-needed) (:array-type ':simple-array)
  5. ;;;           (:array-slicing nil) (:declare-common nil)
  6. ;;;           (:float-format double-float))
  7.  
  8. (in-package "SLATEC")
  9.  
  10.  
  11. (defun initds (os nos eta)
  12.   (declare (type single-float eta)
  13.            (type f2cl-lib:integer4 nos)
  14.            (type (simple-array double-float (*)) os))
  15.   (prog ((initds 0) (i 0) (ii 0) (err 0.0f0))
  16.     (declare (type single-float err) (type f2cl-lib:integer4 ii i initds))
  17.     (if (< nos 1)
  18.         (xermsg "SLATEC" "INITDS" "Number of coefficients is less than 1" 2 1))
  19.     (setf err 0.0f0)
  20.     (f2cl-lib:fdo (ii 1 (f2cl-lib:int-add ii 1))
  21.                   ((> ii nos) nil)
  22.       (tagbody
  23.         (setf i (f2cl-lib:int-sub (f2cl-lib:int-add nos 1) ii))
  24.         (setf err
  25.                 (+ err (abs (f2cl-lib:freal (f2cl-lib:fref os (i) ((1 *)))))))
  26.         (if (> err eta) (go label20))
  27.        label10))
  28.    label20
  29.     (if (= i nos)
  30.         (xermsg "SLATEC" "INITDS"
  31.          "Chebyshev series too short for specified accuracy" 1 1))
  32.     (setf initds i)
  33.     (go end_label)
  34.    end_label
  35.     (return (values initds nil nil nil))))
  36.  
  37.